<?php
/**
 * Created by yusheng
 * Date: 2018/7/19
 * Time: 下午1:24
 */

namespace App\Scopes;

use Illuminate\Database\Eloquent\Scope;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;

class OrderScope implements Scope
{

    public function apply(Builder $builder, Model $model)
    {
        return $builder->whereNotNull('paid_at');
    }
}